package imageviewer.persistence;

import java.sql.Connection;
import java.sql.DriverManager;

import picturetaker.persistence.JNDIFactory;

public class Database  {

	private static Connection con = null;

	private Database() {
	}

	public static Connection getConnection() {
		if (con == null) {
			initConnection();
		}
		return con;
	}

	private static void initConnection() {
        try {
        	con = JNDIFactory.getInstance().getConnection("jdbc/waiDB");
		} catch (Exception e) {
			// Ignore
		}
	}
}
